//
//  AppManager.h
//  AAPowerApp
//
//  Created by 李恺然 on 2018/11/25.
//  Copyright © 2018 Karl. All rights reserved.
//

#import <Foundation/Foundation.h>

@class ConfigModel;

typedef NS_ENUM(NSInteger, UserLanguage) {
    UserLanguageEng,
    UserLanguageChn
};

@interface AppManager : NSObject

@property (nonatomic, copy) NSString *cookieStr;
@property (nonatomic, copy) NSString *userName;
@property (nonatomic, copy) NSString *psw;
@property (nonatomic, strong) NSDictionary *tempUploadParams;
@property (nonatomic, assign) UserLanguage userLanguage;
@property (nonatomic) ConfigModel *config;

+ (instancetype)sharedManager;

- (void)fetchConfigWithCompetedHandler:(void (^)(NSError *))completedHandler;

- (void)loginWithUserName:(NSString *)userName
                      psw:(NSString *)psw
          competedHandler:(void (^)(NSError *))completedHandler;

- (void)autoLoginWithCompetedHandler:(void (^)(NSError *))completedHandler;

- (void)logoutWithCompetedHandler:(void (^)(NSError *))completedHandler;

@end
